package br.com.sistema.conexao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class Entity {

	private static final EntityManagerFactory emf = 
			Persistence.createEntityManagerFactory("sistema");
	
	public static EntityManagerFactory getEmf() {
		return emf;
	}

	public static EntityManager createEm(){
		try {
			return getEmf().createEntityManager();
		} catch (RuntimeException  e) {
			throw e;
		}
	}

}
